package main

import (
	"fmt"
	"time"
)

func main() {
	for i := 0; i < 100; i++ {
		v := roundDurationUp(time.Duration(i)*time.Second, time.Second)
		fmt.Printf("i = %d , v = %d\n", i, v)
	}
}

func roundDurationUp(d time.Duration, to time.Duration) time.Duration {
	return (d + to - 1) / to
}
